package com.yunji.storage.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.yunji.storage.bo.StockTakeResetBO;
import com.yunji.storage.domain.StockTakeDO;
import org.apache.ibatis.annotations.Select;


/**
 * @Package com.yunji.storage.mapper
 * FileName:	StockTakeMapper.java
 * Copyright:	Copyright © 2024 All Rights Reserved
 * Company:		云集互联
 * @version: 1.0
 * @since: JDK 1.8.0_202
 * Create at:   2024-08-30 09:46:36.299
 * Description:
 * 盘点表数据交互
 * Modification History:
 * Author					Date						Version			Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-08-30 09:46:36			1.0				1.0 Version
 */
public interface StockTakeMapper extends MPJBaseMapper<StockTakeDO> {

    @Select("<script> UPDATE v3_stocktake_table " +
            "        <trim prefix=\"SET\" suffixOverrides=\",\">" +
            "            <if test=\"auditId != null\">audit_id = null,</if>" +
            "            <if test=\"auditBelongId != null\">audit_belong_id = null,</if>" +
            "            <if test=\"auditName != null\">audit_name = null,</if>" +
            "            <if test=\"auditBelongName != null\">audit_belong_name = null,</if>" +
            "            <if test=\"auditTime != null\">audit_time = null,</if>" +
            "            <if test=\"auditStatus != null\">audit_status = null,</if>" +
            "        </trim>" +
            "        WHERE stocktake_id = #{stockTakeId} and del_flag = 0 </script>")
    void reset(StockTakeResetBO bo);

}
